print("===========================================================")
print("======================== 1. if 体验 =======================")
print("===========================================================")

# score = int(input("请输入您的分数："))
score = 100
if score >= 90:
    print("分数：%d    评级：优秀" % score)
elif score >= 60:
    print("分数：%d    评级：及格" % score)
elif score < 60:
    print("分数：%d    评级：不及格" % score)

print("评级结束！")

print("- 逻辑运算符 ")

# age = int(input("请输入您的年龄："))
age = 28
if age >= 0 and age <= 120:
    print(f"您输入的年龄为{age}，属于合法格式")
else:
    print("年龄不正确")


# 有一门及格，考试就通过
python_score = 80
c_score = 60
if python_score >= 60 or c_score >= 60:
    print("考试通过")
else:
    print("考试失败，请继续努力")


print("===========================================================")
print("======================== 2. if 进阶 =======================")
print("===========================================================")

# 火车站安检案例
has_ticket = True   # 是否有车票
knife_length = 19   # 火车票长度

if has_ticket:
    print("车票检查通过！准备通过安检！")
    if knife_length >= 20:
        print("您携带的刀太长了，超过 20 公分！")
    else:
        print("您已通过安检！祝您旅途愉快！")
else:
    print("老大，请先买票！")


print("===========================================================")
print("======================== 3. if 综合应用 ====================")
print("===========================================================")
'''
1. 从控制台输入要出的拳 -- 石头（1）/ 剪刀（2）/ 布（3）
2. 电脑 *随机* 出拳 -- 先假定电脑只会出石头，完成整体代码功能
3. 比较胜负
'''
import random

print("石头剪刀布游戏 - 【 石头（1）/ 剪刀（2）/ 布（3）】")

player = int(input("请输入您要出的拳："))
computer = random.randint(1, 3)

print(f"玩家出拳：{player}")
print(f"电脑出拳：{computer}")

# 比较胜负
if (player == 1 and computer == 2) or (player == 2 and computer == 3) or (player == 3 and computer == 1):
    print("哦耶，玩家胜利，电脑弱爆了！")
elif (computer == 1 and player == 2) or (computer == 2 and player == 3) or (computer == 3 and player == 1):
    print("电脑胜利！")
elif computer == player:
    print("平局！")

